package com.saohuobang.test.controller;

import com.saohuobang.test.model.core.APIResponse;
import com.saohuobang.test.service.FrameworkService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 作者 yaohua.liu
 * 日期 2015-12-17 14:00
 * 说明 后端控制接口
 */
@Controller
public class FrameworkController extends AbstractController{

    @Resource
    private FrameworkService frameworkService;

    @RequestMapping("/stop")
    @ResponseBody
    public Object stop(){
        return APIResponse.returnSuccess("关闭的服务数量为："+frameworkService.stop());
    }

    @RequestMapping("/restart")
    @ResponseBody
    public Object restart(){
        return APIResponse.returnSuccess(frameworkService.restart());
    }

    /*@RequestMapping("/start")
    @ResponseBody
    public Object start(){
        return APIResponse.returnSuccess(frameworkService.start());
    }*/

    @RequestMapping("/seeProperties")
    @ResponseBody
    public Object seeProperties(){
        return APIResponse.returnSuccess(frameworkService.getBusinessInfos());
    }
}
